package actionScripts.control
{
	import actionScripts.LoginModelLocator;
	import actionScripts.commands.GlobalRemoteServiceCalls;
	import actionScripts.events.LoginDataEvent;

	public class LoginController
	{
		//----------------------
		// PRIVATE VARIABLES
		//----------------------
		private var appModelLocator 	: LoginModelLocator 		= LoginModelLocator.getInstance();
		private var globalRemoteService	: GlobalRemoteServiceCalls  = new GlobalRemoteServiceCalls();
		public function LoginController()
		{
			appModelLocator.addEventListener( LoginDataEvent.VALIDATE_USER, globalRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( LoginDataEvent.CHECK_USERNAME, globalRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( LoginDataEvent.REGISTER_USER, globalRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( LoginDataEvent.FORGOT_PASSWORD, globalRemoteService.execute, false, 0, true );
			
		}
	}
}